<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Hero</title>
</head>
<body>
<script>
    var vm = new Hero({
      data: {
        pwd: '1111111',
        placeholder: '测试我是 placehold',
        x: '0',
        value1: ''
      },
      render(h) {
        return {
          nav: {
            navigationBarHidden: true,
          },
          views: [
            {
              class: 'UIView',
              frame: {x: this.x, w: '1x', h: '1x'},
              image: 'cash',
              hAuto: true,
              contentSizeElementY: true,
              backgroundColor: '000000',
              subViews: [
                {
                  class: 'HeroButton',
                  frame: {w: '0.35x', h: '44'},
                  backgroundColor: '2869D7',
                  titleColor: 'ffffff',
                  title: '登录',
                  size: 20
                },
                {
                  class: 'DRTextField',
                  name: 'marriageStatus',
                  frame: {x: '15', r: '15', y: '20', h: '60'},
                  backgroundColor: 'red',
                  placeHolder: this.placeholder,
                  text: this.value1,
                  enable: true,
                  hideBottomLine: true,
                  events: {
                    textFieldDidEditing: function(data) {
                      this.placeholder = data.value
                    }
                  }
                },
              ]
            }
          ]
        }
      },
      methods: {
        alert() {
        },
        login() {
          this.placeholder = 'I am login'
        },
        editing: function(data) {
          this.value1 = data.value + ''
        }
      },
      created() {
        Hero.callNative.global({key: 'finishLoading'})
        Hero.fetch.get('/', {a: 1})
          .then(function(res) {
            console.log(res)
            this.placeholder = 'fetch'
          }.bind(this))
      }
    })

</script>

</body>
</html>
